# Calculation the perimeter of a square with edge length 
# * *Args*    :
#   - +edge+ -> edge length as double
# * *Returns* :
#   - perimeter of a square as double
def p_square(edge)
  return edge*4 
end


# Calculation the area of a square with edge length 
# * *Args*    :
#   - +edge+ -> edge length as double
# * *Returns* :
#   - area of a square as double
def s_square(edge)
  return edge*edge
end


# Calculation the perimeter of a rectangle with width and height
# * *Args*    :
#   - +width+ -> rectangle's width
#   - +height+ -> rectangle's height
# * *Returns* :
#   - perimeter of a rectangle as double
def p_rect(width, height)
  return (width + height)/2
end


# Calculation the area of a rectangle with width and height
# * *Args*    :
#   - +width+ -> rectangle's width
#   - +height+ -> rectangle's height
# * *Returns* :
#   - area of a rectangle as double
def s_rect(width, height)
  return width*height
end


# Calculation the perimeter of a circle with radius
# * *Args*    :
#   - +radius+ -> radius as double
# * *Returns* :
#   - perimeter of a circle as double
def p_circle(radius)
  return (2 * Math::PI * radius)
end


# Calculation the area of a square with edge length 
# * *Args*    :
#   - +radius+ -> radius as double
# * *Returns* :
#   - area of a square as double
def s_circle(radius)
  return (Math::PI * radius* radius)
end
